<!------------------- 头部CSS部分 start-------------------------------------------------------------------------------->
{include file="Public/head"/}
<!------------------- 头部CSS部分 end---------------------------------------------------------------------------------->

<body class="no-skin">

<!---------------------头部消息栏,用户栏 start------------------------------------------------------------------------->
{include file="Public/header"/}
<!---------------------头部消息栏,用户栏 end--------------------------------------------------------------------------->

<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <!-------------------------菜单栏 start---------------------------------------------------------------------------->
    {include file="Public/menu"/}
    <!-------------------------菜单栏 end------------------------------------------------------------------------------>

    <div class="main-content">
        <div class="main-content-inner">

            <!-------------------------------路径导航 面包屑 start--------------------------------------------->
            {include file="Public/breadcrumbs"/}
            <!-------------------------------路径导航 面包屑 end----------------------------------------------->

            <div class="page-content">

                <!-----------------------------右侧设置 页面提示消息 start------------------------------------->
                {include file="Public/set"/}
                <!-----------------------------右侧设置 页面提示消息 end--------------------------------------->

                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" action="{:url('Menu/adminUpdate')}" method="post">
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10">
                                    上级菜单
                                </label>
                                <div class="col-sm-9">
                                    <select name="pid" class="rcol-xs-10 col-sm-5">
                                        <option value="0" {if condition="$currentmenu.pid eq 0"}selected="selected"{/if}>
                                            顶级菜单
                                        </option>
                                        {volist name="menuList" id="v"}
                                            <option value="{$v.id}" {if condition="$currentmenu.pid eq $v.id"}selected="selected"{/if}>
                                                {$v.name}
                                            </option>
                                            {notempty name="v.children"}
                                                {volist name="v.children" id="vv"}
                                                    <option value="{$vv.id}" {if condition="$currentmenu.pid eq $vv.id"}selected="selected"{/if}>
                                                        &nbsp;&nbsp;┗━{$vv.name}
                                                    </option>
                                                {/volist}
                                            {/notempty}
                                        {/volist}
                                    </select>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 菜单名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="name" id="name" placeholder="请输入菜单名称" class="rcol-xs-10 col-sm-5" value="{$currentmenu.name}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 链接 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="url" placeholder="链接，如：Index/index"
                                           class="col-xs-10 col-sm-5" value="{$currentmenu.url}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2">
                                    ICON图标 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="icon" placeholder="图标代码，如：menu-icon fa fa-caret-right" class="col-xs-10 col-sm-5" value="{$currentmenu.icon}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"><a href="http://fontawesome.dashgame.com/" target="_blank">图标官网</a></span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 显示状态 </label>
                                <div class="col-sm-9">
                                    <div class="radio">
                                        <label>
                                            <input name="status" type="radio" class="ace" value="1" checked="checked" {if condition="$currentmenu.status eq 1"}checked="checked"{/if} />
                                            <span class="lbl">显示</span>
                                        </label>
                                    <label>
                                        <input name="status" type="radio" class="ace" value="2" {if condition="$currentmenu.status eq 2"}checked="checked"{/if} />
                                        <span class="lbl">隐藏</span>
                                    </label>
                                    </div>
                                </div>
                                <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
										</span>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 排序 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="sort" placeholder="排序数值" class="col-xs-10 col-sm-5" value="{$currentmenu.sort}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">越小越靠前</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 页面提示</label>
                                <div class="col-sm-9">
                                    <textarea name="tips" placeholder="页面提示" class="col-xs-10 col-sm-5" rows="5">
                                        {$currentmenu.tips}
                                    </textarea>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                            <input name="id" value="{$currentmenu.id}" type="hidden">
                            <input type="hidden" name="__token__" value="{$Request.token}" />
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--------------------------------底部版权 置顶 start------------------------------------------------------>
    {include file="Public/footer"/}
    <!--------------------------------底部版权 置顶 end-------------------------------------------------------->

</div>

<!--------------------------------------底部JS start----------------------------------------------------------->
{include file="Public/footerjs"/}
<!--------------------------------------底部JS end------------------------------------------------------------->

<script src="/static/admin/kindeditor/kindeditor-min.js"></script>
<script src="/static/admin/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript">
    $(function () {
        var editor = KindEditor.create('textarea[name="tips"]', {
            resizeType: 1,
            allowPreviewEmoticons: false,
            allowImageUpload: false,
            items: [
                'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'link']
        });
        $(".btn.btn-info").click(function () {
            var title = $("#name").val();
            if (title == '') {
                bootbox.alert({
                    buttons: {
                        ok: {
                            label: '确定',
                            className: 'btn-myStyle'
                        }
                    },
                    message: '菜单名称不能为空。',
                    title: "友情提示",
                });
                return false;
            }

        })
    })
</script>

</body>
</html>
